////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2012 Kentaro Sekimoto  All rights reserved.
////////////////////////////////////////////////////////////////////////////

#ifndef MP3_DEBUG_H_
#define MP3_DEBUG_H_

#include <stdarg.h>

#ifdef __cplusplus
extern "C" int _dbg_printf( int ch, const char* format, ...);
#else
int _dbg_printf( int ch, const char* format, ...);
#endif

//#define MP3_DEBUG
#define CH_COM  1
#define CH_LCD  2
#define CH_BOTH (CH_COM | CH_LCD)

#ifdef MP3_DEBUG
#define MP3_ENTER(ch)               _dbg_printf(ch, "%s ENTER\n", __FUNCTION__)
#define MP3_EXIT(ch)                _dbg_printf(ch, "%s EXIT \n", __FUNCTION__)
#define MP3_TRACE1(ch, a)           _dbg_printf(ch, (const char *)a)
#define MP3_TRACE2(ch, a, b)        _dbg_printf(ch, (const char *)a, b)
#define MP3_TRACE3(ch, a, b, c)     _dbg_printf(ch, (const char *)a, b, c)
#else
#define MP3_ENTER(ch)
#define MP3_EXIT(ch)
#define MP3_TRACE1(ch, a)
#define MP3_TRACE2(ch, a, b)
#define MP3_TRACE3(ch, a, b, c)
#endif

#endif /* MP3_DEBUG_H_ */
